import axios from 'axios';

const baseUrl = '/api';
// 查询在线设备编号 /terminals
export const getTerminals = () => axios.get(`${baseUrl}/terminals`);
// 查询行波电流数据 /terminals/{sn}/xb?
export const getTerminalsXB = sn => axios.get(`${baseUrl}/terminals/${sn}/xb`);
// 查询故障电流数据 /terminals/{sn}/gz
export const getTerminalsGZ = sn => axios.get(`${baseUrl}/terminals/${sn}/gz`);
// 查询设备故障数据 /terminals/{sn}/fault
export const getTerminalsFault = sn => axios.get(`${baseUrl}/terminals/${sn}/fault`);
// 查询心跳数据 /terminals/{sn}/heart
export const getTerminalsHeart = sn => axios.get(`${baseUrl}/terminals/${sn}/heart`);
// 查询设备基本信息数据 /terminals/{sn}/info
export const getTerminalsInfo = sn => axios.get(`${baseUrl}/terminals/${sn}/info`);
// 查询工况数据 /terminals/{sn}/work
export const getTerminalsWork = sn => axios.get(`${baseUrl}/terminals/${sn}/work`);
// 查询参数信息 /terminals/{sn}/param
export const getTerminalsParam = sn => axios.get(`${baseUrl}/terminals/${sn}/param`);
// 设置参数信息 /terminals/{sn}/param
export const postTerminalsParam = (sn, data) => axios.post(`${baseUrl}/terminals/${sn}/param`, data);
// 终端重置 /terminals/{sn}/reset
export const postTerminalsReset = sn => axios.post(`${baseUrl}/terminals/${sn}/reset`);
// 终端升级 /terminals/{sn}/upgrade
export const postTerminalsUp = sn => axios.post(`${baseUrl}/terminals/${sn}/upgrade`);
